/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.diagram.deployment.editpart;

import org.eclipse.draw2d.IFigure;
import org.eclipse.uml2.uml.Deployment;

import com.cea.papyrus.core.editor.ModelManager;
import com.cea.papyrus.core.editpart.connection.NamedGraphEdgeEditPart;
import com.cea.papyrus.diagram.deployment.figure.DeploymentFigure;
import com.cea.papyrus.diagraminterchange2.di2.GraphEdge;
import com.cea.papyrus.diagraminterchange2.di2.Uml1SemanticModelBridge;

/**
 * Manages the model of a deployment.
 * 
 * @author Gilles Cannenterre
 * @since 15 janv. 07
 */
public class DeploymentEditPart extends NamedGraphEdgeEditPart {

	/**
	 * The Constructor.
	 * 
	 * @param graphEdge the graph edge
	 * @param modelManager the model manager
	 */
	public DeploymentEditPart(GraphEdge graphEdge, ModelManager modelManager) {
		super(graphEdge, modelManager);
	}
	
	/**
	 * Gets the uml element.
	 * 
	 * @return the uml element
	 */
	@Override
	public Deployment getUmlElement() {
		return (Deployment) ((Uml1SemanticModelBridge) (getGraphEdge()).getSemanticModel()).getElement();
	}

	/* (non-Javadoc)
	 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
	 */
	/**
	 * 
	 * 
	 * @return 
	 */
	@Override
	protected IFigure createFigure() {
		return new DeploymentFigure();
	}
}